<script setup>
// https://blog.csdn.net/weixin_41185368/article/details/140941611
// 单项数据流理解
import { ref, defineProps, computed } from "vue";
const props = defineProps({
  visiable: Boolean,
});
const emit = defineEmits(["changeVisible"]);
// const dialogVisible = ref(props.visiable);
const dialogVisible = computed(() => props.visiable);
console.log(props);
const handleClose = () => {
  emit("changeVisible", false);
};
</script>
<template>
  <el-dialog v-model="dialogVisible" title="Tips" width="500" :before-close="handleClose">
    <span>This is a message</span>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="emit('changeVisible', false)">Cancel</el-button>
        <el-button type="primary" @click="emit('changeVisible', false)">
          Confirm
        </el-button>
      </div>
    </template>
  </el-dialog>
</template>
